import { http } from "@/utils/http/index.ts";
import type {
  PageVoProjectWorkloadListVo,
  ProjectWorkloadCreateCmd,
  ProjectWorkloadUpdateCmd
} from "@/api/models/index.ts";

export const myWorkload = (
  current: number,
  size: number,
  startTime?: string,
  endTime?: string
) => {
  return http.get<PageVoProjectWorkloadListVo>("/project/workload/my", {
    params: { current, size, startTime, endTime }
  });
};
export const createWorkload = (workloadCreate: ProjectWorkloadCreateCmd) => {
  return http.post("/project/workload/create", {
    data: workloadCreate
  });
};
export const deleteWorkload = (workloadId: string) => {
  return http.delete("/project/workload", { params: { workloadId } });
};
export const updateWorkload = (workloadUpdate: ProjectWorkloadUpdateCmd) => {
  return http.put("/project/workload", {
    data: workloadUpdate
  });
};
